﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using BeatEmUp.Characters;
using Microsoft.Xna.Framework.Content;

namespace BeatEmUp.Items.Weapons
{
    class WeaponPickUp:CommonElements
    {
        bool isVisible;
        Weapon relatedWeapon;
        public WeaponPickUp(Rectangle position):
            base(position)
        {
            isVisible = false;
        }

        public void LoadContent(ContentManager content)
        {
            base.LoadContent(content.Load<Texture2D>("./Sprites/Misc/E and Z keys"));
        }

        public void Draw(SpriteBatch sb)
        {
            if (isVisible)
                base.Draw(sb);
        }

        public void SetData(Vector2 position,Weapon related)
        {
            relatedWeapon = related;
            base.Position = new Rectangle((int)position.X-image.Width/2,(int)position.Y-image.Height,image.Width,image.Height);
        }

        public Rectangle GetPosition()
        {
            return base.Position;
        }

        public bool IsVisible
        {
            set
            {isVisible = value;}
            get
            { return isVisible; }
        }

        public Weapon RelatedWeapon
        {
            get
            {
                return relatedWeapon;
            }
        }
    }
}
